package com.jxc.model.po;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/***********************************************************************
 * Module:  MemberType.java
 * Author:  Tino
 * Purpose: Defines the Class MemberType
 ***********************************************************************/

/**
 * 会员类型
 * 
 * @pdOid f95229c5-b749-423d-83e9-c4414bd3db3a
 */
@Entity
@Table(name = "HYGL_MEMBER_TYPE")
public class MemberType extends IdEntity implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 8346931348073943689L;
	/**
	 * 类型名称
	 * 
	 * @pdOid 0edb6c96-362e-4e1f-89ab-71cbd572007e
	 */
	private String name;
	/**
	 * 经销商
	 * 
	 */
	private User user;
	/**
	 * 备注
	 * 
	 */
	private String remark;
	/**
	 * 是否删除
	 */
	private Boolean isDeleted;

	/**
	 * 折扣
	 */
	private Discount discount;
	
	/**
	 * 金额上限
	 */
	private Integer maxAmount;
	/**
	 * 金额下限
	 */
	private Integer minAmount;
	
	@ManyToOne(cascade = CascadeType.MERGE)
	@JoinColumn(name = "DISCOUNT_ID")
	public Discount getDiscount() {
		return discount;
	}

	public void setDiscount(Discount discount) {
		this.discount = discount;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID")
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "NAME")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Boolean getIsDeleted() {
		return isDeleted;
	}

	public void setIsDeleted(Boolean isDeleted) {
		this.isDeleted = isDeleted;
	}

	@Column(name = "MAX_AMOUNT")
	public Integer getMaxAmount() {
		return maxAmount;
	}

	public void setMaxAmount(Integer maxAmount) {
		this.maxAmount = maxAmount;
	}
	
	@Column(name = "MIN_AMOUNT")
	public Integer getMinAmount() {
		return minAmount;
	}

	public void setMinAmount(Integer minAmount) {
		this.minAmount = minAmount;
	}
	

}